package com.bailu.zsb_back.service.impl;

import com.bailu.zsb_back.entity.Book;
import com.bailu.zsb_back.mapper.BookMapper;
import com.bailu.zsb_back.service.BookService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author dell
 */

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;
    @Override
    public PageInfo<Book> findAllBooks(int page,int limit,String name) {
        PageHelper.startPage(page,limit);
        List<Book> list=bookMapper.findAll(name);
        return new PageInfo<>(list);
    }
}
